package com.cysion.study.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.cysion.study.ktbox.base.BaseAdapter
import com.cysion.study.ktbox.base.BaseViewHolder
import com.cysion.study.ktbox.base.ITEM_CLICK
import com.cysion.study.R
import com.cysion.study.entity.BankEntity

class BandCardAdapter(mEntities: MutableList<BankEntity>, mContext: Context) :
    BaseAdapter<BankEntity>(mEntities, mContext) {

    companion object {

        //点击事件
        const val refuse = 2000
        const val agree = 2001
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder<BankEntity> {
        return ProMoneyHolder(
            LayoutInflater.from(mContext).inflate(R.layout.item_band_card, parent, false)
        )
    }

    class ProMoneyHolder(itemView: View) : BaseViewHolder<BankEntity>(itemView) {
        override fun fillData(obj: BankEntity, position: Int) {
            itemView?.apply {
                //                itemView.tv_data.text=
//                tv_time.text = obj.createTime
                itemView.setOnClickListener {
                    mOnTypeClickListener?.invoke(obj, position, ITEM_CLICK)
                }
            }

        }

    }
}